import App from './App'

// #ifndef VUE3
import Vue from 'vue'
import './uni.promisify.adaptor'
Vue.config.productionTip = false
App.mpType = 'app'
const app = new Vue({
	...App
})
app.$mount()
// #endif

// #ifdef VUE3
import {
	createSSRApp
} from 'vue'
import api from '@/common/vmeitime-http/index.js'
import $const from '@/utils/const.js'
export function createApp() {
	const app = createSSRApp(App)
	// app.config.globalProperties.$utils = $utils
	app.config.globalProperties.$api = api
	app.config.globalProperties.$const = $const
	uni.getSystemInfo({
		success: function(e) {
			app.config.globalProperties.StatusBar = e.statusBarHeight;
			app.config.globalProperties.safeAreaBottom = e.safeAreaInsets.bottom
			if (e.platform == 'android') {
				app.config.globalProperties.CustomBar = e.statusBarHeight + 50;
			} else {
				app.config.globalProperties.CustomBar = e.statusBarHeight + 45;
			};
		}
	})
	return {
		app
	}
}
// #endif
